#coding:utf-8

class TestClass:
	def method1(self):
		print("方法1")

def method2(self):
	print("方法2")

TestClass.method2 = method2

test = TestClass()
test.method1() # 方法1
test.method2() # 方法2